package com.example.demo;

import com.self.selfAutoConfiguration.BambooServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@SpringBootApplication
public class DemoApplication {

    //  由于 spring 自动装配了之前自定义的 bean ，此处直接注入即可，无需实例化
    @Autowired
    private BambooServer bambooServer;

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @RequestMapping("/")
    public String test() {
        return bambooServer.getName();
    }
}
